<template>
	<view>
		<view>
			<view class="top_img">
				<!-- 	<image :src="'https://cdn-static.yekjx.com/' + goodsData.vmaster_product_image_id" style="width: 100%; height: 100%"></image> -->
				<view class="toDetials" @click="selecfoodTodetial">查看详情</view>
				<view>
					<swiper class="swiper" @change="curChanges" :current="currentIndex">
						<swiper-item v-for="(item,index) in imgList" :key="index">
							<view class="swiper-item uni-bg-red">
								<image :src="item.src" style="width: 100%; height: 100%" mode="aspectFill"></image>
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
			<view class="flex stillOrdered align-center" v-if="imgList&&imgList.length > 1">
				<view class="textStyle">TA还点了</view>
				<view class="flex inglist">
					<view class="image" v-for="(item,index) in imgList" @click="selecfood(item,index)"
						:class="{hover : index == selecfoodIndex}" :key="index">
						<image :src="item.src" style="width: 100%; height: 100%" mode="aspectFill"></image>
					</view>
				</view>
			</view>
			<view class="store_contents btn-top" v-if="goodsData && goodsData.length > 0">
				<view class="store_name pa_s">
					<view class="store_n">
						<view class="name_left">{{goodsData[selecfoodIndex].name}}<text class="fcon-dajiaduzaimai"
								style="color:#EF0606;font-weight:400;font-size:40rpx"
								v-if="goodsData.shopTop=='1'"></text></view>
					</view>
					<view class="store_r" v-if="goodsData[selecfoodIndex].energy">
						<text class="fcon-kaluli"
							style="color:#FDBD2F;font-weight:400;font-size:40rpx;margin-right:-6rpx" />
						<view class="name_right">{{goodsData[selecfoodIndex].energy}}Kcal</view>
					</view>
				</view>
				<view class="storePrice pa_s">
					<view class="price_left flex">
						<view class="prices">{{goodsData[selecfoodIndex].price }}</view>
						<view class="reduce" v-if="goodsData[selecfoodIndex].vtwo_type!='814'">¥{{goodsData[selecfoodIndex].oldPrice}}</view>
            <view class="spcPrice padding-lr-xs" v-if="goodsData[selecfoodIndex].activityType=='243'">
              <image :src="env.FileUrl+'food/ico/images/act_tejia.png'" style="width: 100%;height:100%" mode=""></image>
            </view>
					</view>
					<view class="price_right" @click="changeFave">
						<text class="fcon-yixihuan icons" v-if="goodsData[selecfoodIndex].isFavourite" />
						<text class="fcon-xihuan icons" v-else />
						<view class="fav" v-if="goodsData[selecfoodIndex].isFavourite">已喜欢</view>
						<view class="fav" v-else>喜欢</view>
					</view>
				</view>
			</view>
		</view>
		<view class="invs"></view>
		<view class="store_contents">
			<view class="pl_jinxuan" :style="{ paddingBottom: commentList.length <= 0 ? '130rpx' : '180rpx' }">
				<block v-if="mainevl.bill_id">
					<!-- <置顶评价> -->
          <view>
            <view class="jx_info">
            	<view class="info_l">
            		<image class="ev_imgs" src="https://cdn-static.yekjx.com/food/ico/images/eva_ico01.png"
            			v-if="evalState=='2'"></image>
            		<image src="https://cdn-static.yekjx.com/food/ico/images/eva_ico02.png"
            			v-if="evalState=='1'">
            		</image>
            		<view class="l_tx">
            			<image :src="mainevl.vphoto"></image>
            		</view>
            		<text class="l_username">{{mainevl.vnick || '微信用户'}}</text>
            	</view>
            	<view class="l_times">
            		{{mainevl.time}}发布
            	</view>
            </view>
            <view style="margin-top:30rpx;padding: 0rpx 20rpx 0rpx 20rpx;">
            	<uni-rate disabled="true" disabledColor="#FE9870" allow-half :value="mainevl.grade" color="#fff"
            		activeColor="#FE9870" size="14" />
            </view>
          </view>
					<!-- 图片版 -->
          <!--  -->
					<view v-if="mainevl.imList && mainevl.imList.length > 0" class="pl_images_main flex-direction" style="margin-bottom: 20rpx;">
            <view class="pl_images_main line-height" style="padding-left: 0;">
            	{{mainevl.content}}
            </view>
            <view class="pl_im_item_main_con">
             <!-- <view class="pl_im_item_main flex" v-for="(it,ind) in 4" :key="ind">
              	<image src="https://test-cdn-static.yekjx.com/resouces/goods/1726280811586.jpg" style="width: 100%;height: 100%;border-radius: 10rpx;"></image>
              </view> -->
              <view class="pl_im_item_main flex" v-for="(it,ind) in mainevl.imList" :key="ind"
              	@click.stop="handelPre(mainevl.imList,ind)">
              	<image :src="it" style="width: 100%;height: 100%;border-radius: 10rpx;"></image>
              </view>
            </view>
					</view>
					<!-- 文字版 -->
					<view class="pl_images_main line-height padding-bottom-xs" v-else>
						{{mainevl.content}}
					</view>
					<!-- 点赞数据-7 -->
					<!-- <view class="units">
				 	  <view class="unir_l">
				 	  	<text class="fcon-pinglun" style="font-size:32rpx;display: block;margin-top:5rpx;"></text>
							<text style="margin-left:10rpx;font-size: 24rpx;display: block;margin-top:5rpx;">33</text>
				 	  </view>
						<view class="unit_r">
							 <text class="fcon-zan1" style="font-size:32rpx;display: block;margin-top:5rpx;margin-right: 5rpx;" v-if="!mainevl.myfav" @tap="mainevl.myfav=!mainevl.myfav"></text>
							 <text class="fcon-yizan1" style="color:#FE4066;font-size:32rpx;display: block;margin-top:5rpx;margin-right: 5rpx;" v-else @tap="mainevl.myfav=!mainevl.myfav"></text>
							 <view style="font-size: 24rpx;color:#666;margin-top:8rpx;">5703</view>
							 <view class="incs"></view>
							 <text class="fcon-cai1" style="font-size:32rpx;display: block;margin-top:5rpx;margin-right: 5rpx;" v-if="!mainevl.unfav" @tap="mainevl.unfav=!mainevl.unfav"></text>
							 <text class="fcon-yicai1" style="color:#BDBDBD;font-size:32rpx;display: block;margin-top:5rpx;margin-right: 5rpx;" v-else  @tap="mainevl.unfav=!mainevl.unfav"></text>
						</view>
				 </view> -->
					<view class="busBack" v-if="mainevl.reply_content">
						<view class="back_top">
							<view class="flex">
								<view class="logoS">
									<text class="fcon-logo" style="color: #fff;font-size: 36rpx;"></text>
								</view>
								<view class="bu_te">
									商家回复
								</view>
							</view>
							<view class="ba_date">2024-02-29</view>
						</view>
						<view class="ba_info">
							{{mainevl.reply_content}}
						</view>
					</view>
          <view class="w_invs"></view>
					<view class="bg-white">
						<view class="involved" v-if="isLikesNumber || notLikesNumber">{{percentage}}%食友赞同了</view>
            <view class="involved" v-else>你认可TA的说法吗</view>
						<view class="in_con">
							<view class="ag_text"><text v-if="agreeState=='0'"
									style="color: #999;">已有{{totalLike}}人参与</text><text v-if="agreeState=='1'"
									style="color: #5DB175;">已选赞同</text><text v-if="agreeState=='2'"
									style="color: #5DB175;">已选不赞同</text></view>
							<view class="ag_total">{{isLikesNumber}}<text
									style="margin-left:10rpx;margin-right: 10rpx;">:</text>{{notLikesNumber}}</view>
							<view class="agree" @tap="agreeWithFn('1')"
								:style="{ border: agreeState == '0' ? '6rpx solid #5DB175' : agreeState == '1' ? '6rpx solid #5DB175' : agreeState == '2' ? '6rpx solid #D1D1D1' : '',backgroundColor:agreeState == '0' ? '#fff' : agreeState == '1' ? '#5DB175' : agreeState == '2' ? '#FFFFFF' : '' }">
								<text class="fcon-zan1" style="font-size: 65rpx;color:#666;"
									v-if="agreeState=='0'||agreeState=='2'"></text>
								<text class="fcon-yizan1" style="font-size: 65rpx;color:#fff;" v-else></text>
							</view>
							<view class="schedule">
								<view class="now_schedule" :style="{ width : percentage + '%' }">
									<image src="https://cdn-static.yekjx.com/food/ico/images/eva_ico04.png"
										class="sche_img">
									</image>
								</view>
							</view>
							<view class="disagree" @tap="agreeWithFn('2')"
								:style="{backgroundColor:agreeState == '0' ? '#fff' : agreeState == '1' ? '#fff' : agreeState == '2' ? '#D1D1D1' : '' }">
								<text class="fcon-cai1" style="font-size: 65rpx;color:#666;"
									v-if="agreeState=='0'||agreeState=='1'"></text>
								<text class="fcon-yicai1" style="font-size: 65rpx;color:#fff;" v-else></text>
							</view>
						</view>

						<view class="agree_tt" v-if="false">
							<view style="margin-left: 10rpx;">赞 同</view>
							<view>不 赞 同</view>
						</view>
						<view class="w_invs" v-if=" commentList.length > 0"></view>
					</view>
					<!-- <置顶评价> -->
				</block>
				<view class="more_l bg-white" v-if="totalRows&&isShowDiscuss">
					更多评价（{{totalRows}}）
				</view>

				<view class="other_pl" v-if="commentList.length > 0&&isShowDiscuss">
					<view class="comment" v-for="(item,index) in commentList" :key="index">
						<view class="avtor">
							<image :src="item.vphoto" class="avotorImg"></image>
						</view>
						<view class="pl_info">
							<view class="pl_n  flex-direction">
								<view class="pln_n flex justify-between margin-bottom-xs">
									<text>{{item.vnick || '微信用户'}}</text>
									<text>{{item.time}}</text>
								</view>
								<view style="margin-bottom: 10rpx;">
									<uni-rate disabled="true" disabledColor="#FE9870" allow-half :value="item.grade"
										color="#fff" activeColor="#FE9870" size="16" />
								</view>
								<view class="pln_d">{{item.content}}</view>
							</view>
							<view class="pl_del">{{item.authpl}}</view>
							<!-- <view class="ppl_im" v-if="item.imgs.length>0">
								<view class="pl_im_item" v-for="(it,ind) in item.imgs" :key="ind" @tap="handelPre(item.imgs,ind)">
										<image :src="it" style="width: 100%;height: 100%;"></image>
								</view>
							</view> -->
							<view class="other_pl_unit">
								<view class="pl_ut_l">
									<!-- <text class="fcon-pinglun"
										style="font-size:32rpx;display: block;margin-top:5rpx;"></text>
									<text
										style="margin-left:10rpx;font-size: 24rpx;display: block;margin-top:5rpx;">{{item.totalpl}}</text> -->
								</view>
								<view class="pl_ut_r">
									<text class="zicobox" :class="item.myfav?'red fcon-yizan1':'fcon-zan1'"
										 @click="listlikes(item,'1')"></text>
									<text v-if="item.like_num">{{item.like_num}}</text>
									<view style="font-size: 24rpx;color:#666;margin-top:7rpx;">{{item.favo}}</view>
									<view class="incs"></view>
									<text class="zicobox" :class="item.unfav?'gry fcon-yicai1':'fcon-cai1'"
										 @click="listlikes(item,'0')"></text>
								</view>
							</view>
						</view>
					</view>
          <view class="flex justify-center" v-if="pageInfo.curPage >= 1 && !isloading">
            <uni-load-more :status="loadStatus" iconType="circle"></uni-load-more>
          </view>
				</view>
			</view>
			<!-- <view style="height:54.8vh" v-else>
        <empty positions="relative" :empty="commentList.length<=0" zIndexs="22"
        	:imgUrl="'https://cdn-static.yekjx.com/'+'food/empty/images/empty_ico04.png'" content="暂无评论">
        </empty>
      </view> -->
		</view>
		<uni-popup ref="isfavRef" type="center">
			<view class="modelcon">
				<view class="favs">喜欢</view>
				<view class="fav_v">菜品或有变动，点赞喜欢菜品后，第一时间掌握美食动态哦！</view>
				<view class="foot_btn">
					<view class="btns can" @click="cals(false)">我知道了</view>
					<!-- <view class="btns su" @tap="cals(true)">好的</view> -->
				</view>
			</view>
		</uni-popup>
    <loading></loading>
		<addShopping :flag="false" :shopCarPrice="shopCarPrice?.[selecfoodIndex]" @addCar="addCar" :goodsSells="goodsData?.[selecfoodIndex]?.nsell_nums" :vstatus="goodsData?.[selecfoodIndex]?.vstatus"></addShopping>
		<speciModal ref="popup1" @submit="doSubmit" @maskClick="maskClick"></speciModal>
		<delivery-time-op  @timeCallback="timeCallback" dodge ref='reserve' :barHidth='860'
			title="选择预送达时间" source="addYd">
		</delivery-time-op>
		<!-- <view class="balance_box" :style="{zIndex:'999999'}">
			<view class="bottom_balance">
				<view class="imagess">
					<image :src="env.FileUrl+'food/images/car_ico01.png'" style="width: 100%;height: 100%;"></image>
					<uni-badge class="uni-badge-left-margin total" :text="3" absolute="rightTop" :offset="[-3, -3]"
						size="normal">
					</uni-badge>
				</view>
				<view class="amount">
					<text class="unit">¥</text>
						<text class="totalPay">20</text>
				</view>
				<view class="reduction">
					<view class="totalReduce">¥30</view>
					<view class="deliveryFee">配送时间约30分钟</view>
				</view>
				<view class="submitBtn" @click="changeMenuCach('add',{id:'1',source:'goodDetail',action:'add'},'/pages/index/menu/menu')">
					<view>加入购物车</view>
				</view>
			</view>
		</view> -->
	</view>
</template>

<script setup lang="ts">
	import { ref,computed } from "vue"
	import { onLoad, onShow, onReachBottom, onShareAppMessage } from "@dcloudio/uni-app"
	import { mnavTo, showLoading, hideLoading, checkOrg } from '@/utils/helper'
	import { takeSaveShare, initShop, getSellerConfig } from '@/utils/public'
	import mapi from '@/utils/mapi'
	import { env } from '@/api/env.js'
	import { varietyEvaluate, setLikes, queryLabelListByGoodsIdn, isShopFavi, topRating, getCommentdetails, getlikeorStepon, getShareDetail } from '@/api/vmeitime-http/index.js'
	import { useCartStore } from '@/stores/cartStore'
	import { useShopStore } from '@/stores/shopStore'
	import speciModal from '@/components/speciModal/speciModal.vue'
	import addShopping from '@/components/addShopping/addShopping.vue'
	// varietyEvaluate
	const emit = defineEmits(["modelClose"])
	// const orderId = ref('10202407239677990053129')
	const orderId = ref()
	const isfavRef = ref()
	const isFavourite = ref(false)
	const goodsId = ref('')
	const goodsData = ref()
	const agreeState = ref("0") //"0"表示为参与,"1"表示赞同,"2"表示不赞同
	const evalState = ref('2')//"0"表示普通评价,"1"表示认真评价,"2"表示专业评价
	const selecfoodIndex = ref(0)  //选择菜
	const isLikesNumber = ref() //置顶 踩
	const notLikesNumber = ref() //置顶 赞
	const totalLike = ref()  //置顶评论参与总人数
	const percentage = ref(0) //赞同人数百分比
	const goodsdiscussid = ref()  //置顶评论id
	const bill_id = ref() //订单ID
	const reserve=ref()
	const cartStore = useCartStore()
	const shopStore = useShopStore()
	const isloading = ref(false) //是否正在请求数据
	const isLogin = ref(false)  //是否登录
	const popup1 = ref()
	const currentIndex = ref(0)
	const imgList = ref([])
	const pageInfo = ref({
		curPage: 1,
		pageSize: 10,
		backCupPage: 2,
		total: 0
	})
	const mainevl = ref<any>({})
	const commentList = ref([
		// {
		// 	authImg: "https://cdn-static.yekjx.com/food/images/det_img07.png",
		// 	authName: "杰**贝",
		// 	authDate: "2024-03-23",
		// 	authpj: "4",
		// 	authpl: "经常点他们家个，超级好吃经常点他们家个",
		// 	imgs: ["https://cdn-static.yekjx.com/food/images/meal_img04.png", "https://cdn-static.yekjx.com/food/images/meal_img05.png", "https://cdn-static.yekjx.com/food/images/meal_img06.png", "https://cdn-static.yekjx.com/food/images/car_img04.png"],
		// 	totalpl: "14",
		// 	favo: "13",
		// 	myfav: true,
		// 	unfav: false,
		// }, {
		// 	authImg: "https://cdn-static.yekjx.com/food/images/det_img07.png",
		// 	authName: "Ac**者",
		// 	authDate: "2024-03-23",
		// 	authpj: "4",
		// 	authpl: "值得回购哦！",
		// 	imgs: [],
		// 	totalpl: "14",
		// 	favo: "13",
		// 	myfav: false,
		// 	unfav: true,
		// }, {
		// 	authImg: "https://cdn-static.yekjx.com/food/images/det_img07.png",
		// 	authName: "D**r",
		// 	authDate: "2024-03-23",
		// 	authpj: "5",
		// 	authpl: "比其他店的更卫生，包装也很精致，吃的放心",
		// 	imgs: [],
		// 	totalpl: "14",
		// 	favo: "13",
		// 	myfav: false,
		// 	unfav: true,
		// }
	])
	const totalRows = ref(0)
	const shopCarPrice = ref()
	const isSan = ref(false)
  const loadStatus = ref('noMore')  //没有更多了
  const loaded = ref(false) //是否在请求数据
	const goods_shareid = ref()
	onLoad(async (options) => {
		if (options.scene) {
			try {
				isSan.value = true
				let sdetail = await getShareDetail({ share_id: options.scene })

				if (sdetail.result && sdetail.object) {
					let nres = JSON.parse(sdetail.object.request_params);
					bill_id.value = nres.billId;
					goods_shareid.value = nres.goods_id
					console.log('getShareDetail', nres, bill_id.value);
					let nparam = {
						shareMemberId: '',
						buy_member_id:nres.buy_member_id||'',
						sellMemberId: nres.sell_member_id || '',//暂
						share_id: options.scene || '',
						event_id_1: nres.event_id || ''
					}
					shopStore.setQrShop(nres.sell_member_id || '')
					checkOrg(nparam)
          loadData(nres.goods_id,nres.billId)
					// getLabel(nres.goods_id,nres.billId)
					// gettopRating(nres.goods_id,nres.billId)
					initShop(loadData, { source: 'refresh' });
					return
				}
				initShop(loadData, { source: 'refresh' });
			} catch (e) {
				initShop(loadData, { source: 'refresh' });
				console.error(e);
			}
			return
		}
		if (options.goodsId) {
			goodsId.value = options.goodsId
			bill_id.value = options.bill_id
			// getLabel(options.goodsId)
			// !loaded.value && loadData()
      loadData(goodsId.value,bill_id.value)
			// getLabel(goodsId.value,bill_id.value)
			// gettopRating(goodsId.value,bill_id.value)
		}
	})
	onShow(() => {
		loaded.value && loadData(goodsId.value,bill_id.value)
	})
  //是否展示评价
 const isShowDiscuss = computed(() => {
      // 确保 goodsData 和 selecfoodIndex 是有效的
      if (goodsData.value && goodsData.value.length > 0 && goodsData.value[selecfoodIndex.value].is_show_discuss ) {
        return goodsData.value[selecfoodIndex.value].is_show_discuss === '5';
      }
      return false; // 默认返回 false
  });
	// 分享好友
	onShareAppMessage(() => {
		return new Promise(async (resolve, reject) => {
			let param = {
				event_id: '4', //事件id  1:会员注册, 2:H5分享， 3:商品价格标签, 4:商品超链接分享, 5:拼团， 6:线下团购,7.总部推广 ,8.VIP专属卡,9.预留1,10.预留2
				source_type: '2', //1首页分享，2商品分享，3名片分享，4商品超链接分享5拼团,6线下团购,7.总部推广 ,8.VIP专属卡,9.预留1,10.预留2
				goods_id: goodsData.value[selecfoodIndex.value].goods_id || '',
				goods_sku: goodsData.value[selecfoodIndex.value].sku || '',
				billId: bill_id.value,
				activity_id: '',
				sell_member_id: shopStore.curSellerMemberId || '', //门店id
			}
			try {
				let shareId = await takeSaveShare(param)
				const shareTits=uni.getStorageSync('shareTitles')
				if (shareId) {
					let msg = {
						title: shareTits || '好食材 健康外卖',
						content: '好食材 健康外卖',
						path: '/pages/user/evalDetails/evalDetails?scene=' + shareId,
						imageUrl: env.imgBaseUrl + goodsData.value[selecfoodIndex.value].vmaster_product_image_id,
					}
					resolve(msg)
				} else {
					reject('');
					mapi.msg('分享失败,请稍后重试')
				}
			} catch (e) {
				reject('');
				mapi.msg('分享失败,请稍后重试')
				console.error(e)
				//TODO handle the exception
			}

		});
	})
	onReachBottom(() => {
		// 判断是否还有下一页数据
		// console.log('页码值页码值----------------------------------------------', curPage.value)
		if (pageInfo.value.curPage * pageInfo.value.pageSize >= pageInfo.value.total)  return  loadStatus.value = 'noMore'  //mapi.msg('数据加载完毕！')total  curPage = 2 * pageSize = 6 >= totalRows = 10 
		if (isloading.value) return
		// 让页码值自增 +1
		pageInfo.value.curPage += 1
		// getLabel(goodsId.value)
		getLabel(goodsId.value,bill_id.value)
		// console.log('加载更多----------------------------------------------', pageInfo.value.curPage)
	})
	//点赞
	const agreeWithFn = (ttyy : any) => {
		// agreeState.value = ttyy
		if (ttyy == '1') {
			giveDz(goodsdiscussid.value, 1, 'individual', mainevl.value.goods_id)
			console.log('赞同', goodsdiscussid.value)
		} else if (ttyy == '2') {
			console.log('取消赞同')
			giveDz(goodsdiscussid.value, 0, 'individual', mainevl.value.goods_id,)
		}
	}
	//列表点赞
	const listlikes = (item : any, flag : any) => {
		if (flag == '1') {
			giveDz(item.goods_discuss_id, 1, 'group', item.goods_id, item)
			// item.unfav = false
			// item.myfav = ! item.myfav
		} else {
			giveDz(item.goods_discuss_id, 0, 'group', item.goods_id, item)
			// item.myfav = false
			// item.unfav = ! item.unfav
		}
		// console.log('列表点赞----------', flag)
	}
	const giveDz = async (id : any, isLikes : any, flag : any, goodsId : any, item ?: any) => {
		try {
			showLoading()
			let res = await getlikeorStepon({
				goodsId: goodsId,
				goodsDiscussId: id,
				isLikes: isLikes
			})
			if (res.result) {
				hideLoading()
				// getLabel(goodsId.value)
				//大点赞
				if (flag == 'individual') {
					if (res.object.cussTag == '5') {
						agreeState.value = '1'
					} else if (res.object.cussTag == '6') {
						agreeState.value = '2'
					} else {
						agreeState.value = '0'
					}
					gettopRating(goodsId,bill_id.value)
					// goodsId.value &&
					// console.log('54645464564----------------------------------------------', goodsId.value)
				}
				// 评论列表点赞
				if (flag == 'group') {
					// commentList.value = []
					// getLabel(goodsId.value)
          if (res.object.cussTag == '5') {
          	item.myfav = true
          	item.unfav = false
            item.like_num = res.object.like_num
          } else if (res.object.cussTag  == '6') {
          	item.myfav = false
          	item.unfav = true
            item.like_num = res.object.like_num
          } else {
          	item.myfav = false
          	item.unfav = false
            item.like_num = res.object.like_num
          }
				}
			}
		} catch (e) {
			hideLoading();
			mapi.msg('点赞网络繁忙，请稍后再试!')
		}
	}

	//加入购物车
	const addCar = () => {
		if(goodsData.value[selecfoodIndex.value].vtwo_type=='816' && !cartStore.curOrderType.type){
			reserve.value.open()
			return
		}
		doAddEvents()
	}
	const doAddEvents=()=>{
		if (goodsData.value[selecfoodIndex.value].specsOnly == '1') {
			popup1.value.open(goodsData.value[selecfoodIndex.value])
		} else {
			doAddActions(goodsData.value[selecfoodIndex.value])
		}
	}
	const doSubmit = (item : any) => {
		doAddActions(item)
	}
	const doAddActions = async (item : any) => {
		let obj = { id: '3', source: 'goodsDetial', action: 'addCars',shopResult:item.result }
		uni.setStorageSync('menuact', obj)
		setTimeout(() => {
			uni.switchTab({
				url: '/pages/index/menu/menu'
			});
		}, 10)
		// showLoading()
		// try {
		// 	let res : any = null
		// 	const baseParams = {
		// 		sku: item.sku,
		// 		nums: 1,
		// 		type: item.shopType=='0'?'sp':'tc',
		// 		defaultServiceType: "795",
  //       labelIds:item.labelIds||[]
		// 	};
		// 	hideLoading()
		// 	let obj = { id: '3', source: 'goodsDetial', action: 'openCarModel' }
		// 	uni.setStorageSync('menuact', obj)
		// 	setTimeout(() => {
		// 		uni.switchTab({
		// 			url: '/pages/index/menu/menu'
		// 		});
		// 	}, 500)
		// 	const params : any = item.isVip == '1' ? { ...baseParams, special_id: item.specialId || '7' } : { ...baseParams };
		// 	if (store.curOrderType && store.curOrderType.type) {
		// 		params.patten = store.curOrderType.type;
		// 		params.subsTime=store.curOrderType.time.dateString
		// 	}
		// 	res = item.isVip == '1' ? await addVipGood(params) : await shopcartAdd(params);
		// 	if (!res.result) {
		// 		mapi.msg(res.shortMessage || "加入购物车失败!")
		// 		hideLoading()
		// 		return
		// 	}
		// 	mapi.msg("加入购物车成功!")
		// } catch (e) {
		// 	hideLoading()
		// }
	}
	//置顶评价
	const gettopRating = async (id : any,billId:any) => {
		try {
			// showLoading()
			let res = await topRating({
				goodsId: id,
        billId:billId
			})
			// hideLoading();
			if (res.result && res.object.content) {
				const { create_date, image1, image2, image3, image4, like_num, disfavour_num, goods_discuss_id, total, is_likes, bill_id } = res.object
				if (is_likes == '5') {
					agreeState.value = '1'
				} else if (is_likes == '6') {
					agreeState.value = '2'
				} else {
					agreeState.value = '0'
				}
				res.object.time = `${create_date.slice(0, 4)}-${create_date.slice(4, 6)}-${create_date.slice(6, 8)}`
				const images = [image1, image2, image3, image4].filter(img => img); // 过滤掉空值
        console.log('imagesimagesimagesimagesimagesimagesimagesimages',images)
				res.object.imList = images.map(img => env.imgBaseUrl + img);
				res.object.vphoto = (res.object.vphoto == '' || !res.object.vphoto) ? '../../../static/default_avos.png' : env.imgBaseUrl + res.object.vphoto
				mainevl.value = res.object  //置顶
				isLikesNumber.value = like_num || 0//点赞的人数
				notLikesNumber.value = disfavour_num || 0//没点赞
				totalLike.value = total || 0//总人数
				percentage.value = Math.round((like_num / total) * 100) || 0//点赞人数百分比
				goodsdiscussid.value = goods_discuss_id
        console.log('置顶评价---------------------------------------',  mainevl.value)
			}
		} catch (e) {
			// hideLoading();
			mapi.msg('置顶评价网络繁忙，请稍后再试!');
		}
	}
	//评价列表
	const getLabel = async (id:any,billd:any,source:any='') => {
		// if(!isLogin.value) return
		// console.log('我是获取评价列表的接口')
		// ** 打开节流阀
    loadStatus.value = 'loading'
		isloading.value = true
		try {
			// showLoading()
			let res = await varietyEvaluate({
				curPage: pageInfo.value.curPage,
				pageSize: pageInfo.value.pageSize,
        billId:billd,
				goodsId: id,
			})
			if(source=='reflash'){
				commentList.value=[]
			}
			// hideLoading();
			if (res.result && res.object) {
				const { page, object } = res
				totalRows.value = page.totalRows
				pageInfo.value.total = page.totalRows
				res.object.forEach((item : any, index : any) => {
					if (item.is_likes == '5') {
						item.myfav = true
						item.unfav = false
					} else if (item.is_likes == '6') {
						item.myfav = false
						item.unfav = true
					} else if (item.is_likes == null) {
						item.myfav = false
						item.unfav = false
					}
					const { create_date, image1, image2, image3, image4 } = item
					item.time = `${create_date.slice(0, 4)}-${create_date.slice(4, 6)}-${create_date.slice(6, 8)}`
					// item.imList.push(image1)

					item.vphoto = (item.vphoto == '' || !item.vphoto) ? '../../../static/default_avos.png' : env.imgBaseUrl + item.vphoto
					const images = [image1, image2, image3, image4].filter(img => img); // 过滤掉空值
					item.imList = images.map(img => env.imgBaseUrl + img);
				})
				commentList.value = [...commentList.value, ...object]
				// console.log('评价详情------------------------------------------------------------', commentList.value)
				isloading.value = false
				goodsId.value = res.object[0].goods_id
				console.log(' goodsId.value-----------------------', goodsId.value, res.object[0].goods_id)
				// if(res.object[0].bill_id){
				//   loadData(res.object[0].bill_id)  //通过订单id获取详情
				// }
			}
		} catch (e) {
			// hideLoading();
			// mapi.msg('评价列表网络繁忙~~~~~~~~~~~~，请稍后再试!');
		}
	}
	//详情
	const loadData = async (goodsid?:any,billId?:any) => {
		// if (isSan.value) {
			await getSellerConfig()
			if(shopStore.orderAgain){
				shopStore.setHasShut(true);
				shopStore.setShutStates('beyonDdistance');
			}
      console.log('什么时候我调用了------------')
		// }
    getLabel(goodsid,billId)
    gettopRating(goodsid,billId)
		try {
      showLoading()
			let res = await getCommentdetails({ billId: bill_id.value })
			loaded.value = true;
      hideLoading()
			// let res = await billDetail({ vbill_id: id })
			if (!res.result) {
				return 
			}

			// let nres = res.object || {}
			imgList.value = res.object[0].goodsAppVo.map((item : any) => {
				return {
					src: env.imgBaseUrl + item.vmaster_product_image_id,
					goodsId: item.goods_id
				}
			})
			res.object[0].goodsAppVo.forEach((item : any) => {
				item.isFavourite = false
				item.isVip = item.vipFlag == '6' ? '0' : '1'
				item.shopType = item.vtwo_type == '813' ? '1' : '0'
        item.price = item.activity ? item.activity_price : (shopStore.costPlan == '1130' ? item.site_sell_price : item.out_sell_price)
        item.oldPrice = item.activity ? (shopStore.costPlan == '1130' ? item.site_sell_price : item.out_sell_price):item.old_price
				item.specsOnly = item.specList && item.specList.length > 1 ||  getSpcFlags(item.goods_id)  ? '1' : '0'
					// item.specsOnly = '0'
				// item.isVip = '0'
				// isVip: item.vipFlag == '6' ? '0' : '1',
			})
			// console.log('图片数组--------', imgList.value)
			shopCarPrice.value = res.object[0].goodsAppVo.map((item : any) => {
				return {
					price: item.activity ? item.activity_price : (shopStore.costPlan == '1130' ? item.site_sell_price : item.out_sell_price),
					oldPrice: item.activity ? (shopStore.costPlan == '1130' ? item.site_sell_price : item.out_sell_price):item.old_price
				}
			})
			goodsData.value = res.object[0].goodsAppVo
			// console.log(goodsData.value)
			// goodsData.value = {
			// 	...nres,
			// 	shopType: nres.vtwo_type == '8103' ? '1' : '0',
			// 	isVip: nres.vipFlag == '6' ? '0' : '1',
			// 	shopTop: "0",
			// 	specsOnly: nres.specList.length > 1 ? '1' : '0',
			// 	num: 0,
			// 	tags: nres.labels_id ? nres.labels_id.split(",") : [],
			// 	id: nres.nsell_category_id,
			// 	totalReduce: nres.old_price,
			// 	// price: nres.activity ? nres.activity_price : (store.costPlan == 0 ? nres.site_sell_price : nres.out_sell_price),
			// 	limited: nres.nsell_nums || 0,
			// 	issellOut: nres.nsell_nums && nres.nsell_nums > 0 ? '1' : '0',
			// }
			// shopCarPrice.value = {
			// 	price: nres.activity ? nres.activity_price : (store.costPlan == 0 ? nres.site_sell_price : nres.out_sell_price),
			// 	oldPrice: nres.old_price
			// }
			if (goods_shareid.value) {
				// console.log('indexNum----------------------', goodsData.value)
				const indexNum = goodsData.value.findIndex((item : any) => {
					return item.goods_id == goods_shareid.value
				})
				selecfoodIndex.value = indexNum
				currentIndex.value = indexNum
			}
			getFav()
		} catch (e) {
			loaded.value = true;
      hideLoading()
			//TODO handle the exception
		}
	}
	let chFavActions = async (types : any) => {
		let res = await setLikes({ type: types, goodsId: goodsId.value })
		if (res.result) {
			getFav()
      if(types === '5'){
        isfavRef.value.open()
        setTimeout(() => {
          isfavRef.value&&isfavRef.value.close();
        }, 3500)
      }
		}
		// isfavRef.value.close()
	}
  const getSpcFlags=async(goodsIds:any)=>{
  	let res=await queryLabelListByGoodsIdn({goodsId:goodsIds})	
  	if(!res.result){
  		return false
  	}
  	if(res.object&&res.object.length>0){
  		return true
  	}else{
  		return false
  	}
  }
	const getFav = async () => {
		if(goodsData.value.length<=0){
			return
		}
		let res = await isShopFavi({ goodsId: goodsId.value })
		if (!res.result) {
			goodsData.value[selecfoodIndex.value].isFavourite = false;
			return
		}
		if (res.msgCode == "5") {
			goodsData.value[selecfoodIndex.value].isFavourite = true;
			// isFavourite.value = true
		} else {
			goodsData.value[selecfoodIndex.value].isFavourite = false;
			// isFavourite.value = false
		}
	}
	//跳转点餐页
	// const changeMenuCach = (type : string='', obj : any, url : string) => {
	// 	// ={id:any,source:string,action:string}
	// 	type == 'add' ? uni.setStorageSync('menuact', obj) : uni.removeStorageSync('menuact')
	// 	uni.switchTab({
	// 		url
	// 	})

	// }
	const changeFave = () => {
		if (goodsData.value[selecfoodIndex.value].isFavourite == false) {
      chFavActions('5')
			// isfavRef.value.open()
		} else {
			chFavActions('6')
		}

	}
	const cals = (v : any) => {
		if (!v) {
			isfavRef.value.close()
		} else {
			chFavActions('5')
		}

	}
	const handelPre = (item : any, index : any) => {
    console.log('handelPre-----------------',item,index,item[index])
		uni.previewImage({
			current: item[index],
			urls: item,
			success: () => {
				console.log("111")
			}
		})
	}
	const toRouter = (url : any) => {
		mnavTo(url)
	}
	//去详情
	const selecfoodTodetial = () => {
		mnavTo('/pages/order/goodsDetial/goodsDetial?shopType=' + '' + '&goodsId=' + goodsId.value)
	}
	const selecfood = (item : any, index : any) => {
		selecfoodIndex.value = index
		currentIndex.value = index
		goodsId.value = item.goodsId
		pageInfo.value.curPage=1
		pageInfo.value.pageSize=10
		pageInfo.value.backCupPage=2
		pageInfo.value.total=0
		

		 getLabel(item.goodsId,bill_id.value,'reflash')
		// console.log(item,"kkk")
		console.log('选泽菜-------------------', goodsId.value, currentIndex.value)
	}
	const curChanges = (e : any) => {
		currentIndex.value = e.detail.current;
		selecfoodIndex.value = e.detail.current
		goodsId.value = imgList.value[e.detail.current].goodsId
		console.log('e-----------------', e.detail.current)
		console.log('滑动选泽了菜', imgList.value[e.detail.current].goodsId)
	}
	const timeCallback = (e : any) => {
			reserve.value.close()
			cartStore.setCurOrderTypeString('SUBSCRIBE')
			doAddEvents()
		}
  const maskClick=()=>{
  	cartStore.setCurOrderTypeString('')
  }
</script>

<style lang="scss" scoped>
	.swiper {
		height: 438rpx;
	}

	.swiper-item {
		display: block;
		height: 438rpx;
		height: 438rpx;
		text-align: center;
	}

	.stillOrdered {
		height: 84rpx;
		background-color: #fff;
		border-bottom: 1px solid #f2f2f2;
		padding: 0 32rpx;

		.inglist {
			.image {
				width: 41.786px;
				height: 27.84px;
				flex-shrink: 0;
				border-radius: 6rpx;
				border: 2px solid #FDFFFE;
        margin-left: 10rpx;
			}

			.hover {
				border: 2px solid #53A87F !important;
			}
		}

		.textStyle {
			color: #999;
			font-size: 28rpx;
			font-style: normal;
			font-weight: 400;
			line-height: normal;
			margin-right: 26rpx;
		}
	}

	.top_img {
		width: 100vw;
		height: 438rpx;
		position: relative;

		.toDetials {
			position: absolute;
			right: 40rpx;
			bottom: 40rpx;
			width: 152rpx;
			height: 56rpx;
			border-radius: 72rpx;
			background: rgba(153, 153, 153, 0.50);
			color: #FFF;
			font-family: "Microsoft YaHei UI";
			font-size: 28rpx;
			font-weight: 400;
			text-align: center;
			line-height: 56rpx;
			padding: 0rpx 10rpx 0rpx 10rpx;
			z-index: 999;
		}
	}

	.store_contents {
		background-color: #fff;
		.store_name {
			display: flex;
			justify-content: space-between;
			padding: 20rpx 20rpx 0rpx 20rpx;
      height: 86rpx;
			.store_n {
				display: flex;

				.name_left {
					padding: 15rpx 25rpx 0rpx 0rpx;
					color: #333;
					font-family: "Microsoft YaHei UI";
					font-size: 40rpx;
					font-style: normal;
					font-weight: 700;
				}
			}

			.store_r {
				display: flex;
				margin-top: 17rpx;

				.name_right {
					color: #333;
					font-family: "Microsoft YaHei UI";
					font-size: 40rpx;
					font-style: normal;
					font-weight: 700;
				}
			}
		}
    .spcPrice {
      min-width: 102rpx;
      height: 44rpx;
      // margin-top: 25rpx;
      margin-left: 15rpx;
      image{
        width: 100%;
        height: 100%;
      }
    }
		.storePrice {
			display: flex;
			justify-content: space-between;
			margin-top: 15rpx;
			padding: 0rpx 20rpx 0rpx 20rpx;
			.price_left {
        align-items: baseline;
				.unit {
					color: #FB1E0F;
					font-family: "Microsoft YaHei UI";
					font-size: 28rpx;
					font-style: normal;
					font-weight: 700;
					line-height: 110rpx;
				}

				.prices {
					color: #FB1E0F;
					font-family: "Microsoft YaHei UI";
					font-size: 64rpx;
					font-style: normal;
					font-weight: 700;
				}

				.reduce {
					color: #999;
					font-family: "Microsoft YaHei UI";
					font-size: 28rpx;
					font-style: normal;
					font-weight: 400;
					line-height: 110rpx;
					text-decoration: line-through;
					margin-left: 10rpx;
				}

				.dz {
					width: 146rpx;
					height: 44rpx;
					border-radius: 10px 0px 10px 10px;
					background: linear-gradient(90deg, #FF7A00 10.22%, #FCDCBF 124.58%);
					line-height: 44rpx;
					margin-top: 25rpx;
					text-align: center;
					margin-left: 10rpx;
					color: #fff;
					font-size: 24rpx;
				}
			}

			.price_right {
				display: flex;
				margin-top: 30rpx;
        width: 129.54rpx;
        height: 92rpx;
				.icons {
					color: #FC4C40;
					margin-right: 10rpx;
				}

				.fav {
					color: #666;
					font-feature-settings: 'clig' off, 'liga' off;
					font-family: "Microsoft YaHei UI";
					font-size: 24rpx;
					font-style: normal;
					font-weight: 400;
					letter-spacing: 2rpx;
				}
			}
		}

		.invs {
			width: 100%;
			height: 1rpx;
			background: rgba(0, 0, 0, 0.06);
			box-shadow: -10rpx -2rpx 10.4rpx 0rpx rgba(0, 0, 0, 0.2);
		}

		.pl_jinxuan {
			width: 100%;
			// margin-top: 20rpx;
			padding-bottom: 180rpx;
      background-color: #fff;
			// padding:0rpx 20rpx 10rpx 20rpx;
			box-shadow: 0px -2rpx 10rpx 0px rgba(0, 0, 0, 0.06);
			.jx_info {
				width: 100%;
				height: 72rpx;
				display: flex;
				justify-content: space-between;
				padding: 20rpx 20rpx 0rpx 20rpx;
				position: relative;

				.ev_imgs {
					position: absolute;
					top: 10rpx;
					right: 150rpx;
					width: 116rpx;
					height: 116rpx;
				}

				.info_l {
					display: flex;

					.l_tx {
						width: 72rpx;
						height: 72rpx;

						image {
							width: 100%;
							height: 100%;
							border-radius: 50%;
						}
					}

					.l_username {
						font-size: 32rpx;
						margin-top: 19rpx;
						margin-left: 13rpx;
					}
				}

				.l_times {
					font-feature-settings: 'clig' off, 'liga' off;
					font-family: "Microsoft YaHei UI";
					font-size: 24rpx;
					font-weight: 400;
					color: #8D95A1;
					margin-top: 27rpx;
				}
			}

			.main_imgs {
				width: 100%;
				height: 456rpx;
				margin-top: 10rpx;
			}
      .line-height{
        line-height: 35rpx;
      }
			.pl_images_main {
        word-break: break-all;
				min-height: 20rpx;
				margin-top: 10rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				padding: 0rpx 20rpx 0rpx 24rpx;
				color: #333;
				font-family: "Microsoft YaHei UI";
				font-size: 28rpx;
				font-weight: 400;
        .pl_im_item_main_con{
          display: flex;
          flex-wrap: wrap;
        }
				.pl_im_item_main {
					width: 340rpx;
					height: 218rpx;
          margin: 20rpx 3.6% 20rpx 0;
          &:nth-child(2n){
            margin-right: 0;
          }
				}
			}

			.units {
				display: flex;
				justify-content: space-between;
				height: 40rpx;
				margin-top: 20rpx;
				padding-right: 10rpx;

				.unir_l {
					font-size: 24rpx;
					color: #666;
					display: flex;
				}

				.unit_r {
					display: flex;

					.incs {
						width: 2rpx;
						height: 36rpx;
						background: #999;
						margin-left: 16rpx;
						margin-top: 5rpx;
						margin-right: 10rpx;
						opacity: 0.2;
					}
				}
			}

			.busBack {
				width: 705rpx;
				min-height: 170rpx;
				border-radius: 20rpx;
				background: rgba(235, 239, 251, 0.50);
				margin: 10rpx auto 30rpx;
				padding: 20rpx 25rpx 20rpx 20rpx;

				.back_top {
					display: flex;
					justify-content: space-between;
          align-items: center;
					.ba_date {
						color: #8D95A1;
						font-feature-settings: 'clig' off, 'liga' off;
						font-family: "Microsoft YaHei UI";
						font-size: 24rpx;
						font-weight: 400;
					}

					.logoS {
						width: 52rpx;
						height: 52rpx;
						border-radius: 50%;
						background-color: #5DB175;
						display: flex;
						justify-content: center;
						align-items: center;
					}

					.bu_te {
						color: #333;
						font-family: "Microsoft YaHei UI";
						font-size: 32rpx;
						font-weight: 400;
						margin-left: 10rpx;
						margin-top: 7rpx;
					}
				}

				.ba_info {
					margin-top: 20rpx;
					color: #333;
					font-feature-settings: 'clig' off, 'liga' off;
					font-family: "Microsoft YaHei UI";
					font-size: 28rpx;
					font-weight: 400;
				}
			}

			.w_invs {
				background: #F6F7F9;
				height: 20rpx;
				margin-top: 10rpx;
			}

			.involved {
				width: 100%;
				color: #333;
				font-feature-settings: 'dlig' on;
				font-family: "Microsoft YaHei UI";
				font-size: 32rpx;
				font-weight: 400;
				padding: 20rpx;
				margin-top: 10rpx;
			}

			.in_con {
				width: 100%;
				height: 106rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				margin-top: 10rpx;
				position: relative;
				margin-bottom: 30rpx;

				.ag_text {
					position: absolute;
					width: 260rpx;
					height: 40rpx;
					top: 0;
					left: 245rpx;
					text-align: center;
					font-family: "Microsoft YaHei UI";
					font-size: 28rpx;
					font-weight: 400;
				}

				.ag_total {
					position: absolute;
					width: 260rpx;
					height: 40rpx;
					top: 75rpx;
					left: 245rpx;
					text-align: center;
					color: #999;
					font-family: "Microsoft YaHei UI";
					font-size: 28rpx;
					font-weight: 400;
				}

				.agree {
					width: 106rpx;
					height: 100%;
					border-radius: 50%;
					background: #FFF;
					box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
					display: flex;
					justify-content: center;
					align-items: center;
					margin-right: -2rpx;
          position: relative;
          z-index: 99;
				}

				.schedule {
					width: 260rpx;
					height: 20rpx;
					background-color: #D1D1D1;

					.now_schedule {
						width: 50%;
						height: 100%;
						background-color: #5DB175;
						display: flex;
						justify-content: flex-end;
						z-index: 10;

						.sche_img {
							width: 20rpx;
							height: 100%;
							margin-right: -20rpx;
						}
					}
				}

				.disagree {
					width: 106rpx;
					height: 100%;
					border-radius: 50%;
					border: 6rpx solid #D1D1D1;
					background: #FFF;
					box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
					display: flex;
					justify-content: center;
					align-items: center;
					margin-left: -2rpx;
					position: relative;
					z-index: 99;
				}
			}

			.agree_tt {
				width: 62%;
				height: 45rpx;
				display: flex;
				margin: 5rpx auto;
				justify-content: space-between;
				color: #333;
				font-feature-settings: 'dlig' on;
				font-family: "Microsoft YaHei UI";
				font-size: 32rpx;
				font-weight: 400;
				margin-bottom: 20rpx;
			}

			.more_l {
				color: #333;
				font-family: "Microsoft YaHei UI";
				font-size: 32rpx;
				font-weight: 400;
				padding: 30rpx 20rpx 0rpx 20rpx;
			}

			.other_pl {
				width: 100%;
				background-color: #fff;
				padding: 0rpx 20rpx 0rpx 20rpx;

				.comment {
					width: 90%;
					min-height: 200rpx;
					margin-left: 2%;
					display: flex;
					padding: 30rpx 0rpx 10rpx 0rpx;

					.avtor {
						width: 72rpx;
						height: 100%;

						.avotorImg {
							width: 100%;
							height: 72rpx;
							border-radius: 50%;
						}
					}

					.pl_info {
						width: 530rpx;
						height: 100%;
						margin-left: 20rpx;

						.pl_n {
							display: flex;
							justify-content: space-between;

							.pln_n {
								color: #333;
								font-feature-settings: 'dlig' on;
								font-family: "Microsoft YaHei UI";
								font-size: 28rpx;
								font-weight: 400;
							}

							.pln_d {
								font-feature-settings: 'clig' off, 'liga' off;
								font-family: "Microsoft YaHei UI";
								font-size: 28rpx;
								font-weight: 400;
								color: #8D95A1;
                word-break: break-all; 
							}
						}

						.pl_del {
							margin-top: 10rpx;
							color: #333;
							font-feature-settings: 'clig' off, 'liga' off;
							font-family: "Microsoft YaHei UI";
							font-size: 28rpx;
							font-weight: 400;
						}

						.ppl_im {
							min-height: 20rpx;
							margin-top: 10rpx;
							display: flex;
							flex-wrap: wrap;
							justify-content: space-between;

							.pl_im_item {
								width: 160rpx;
								height: 100rpx;
								margin-top: 10rpx;
								margin-right: 10rpx;
							}
						}

						.other_pl_unit {
							width: 100%;
							height: 40rpx;
							margin-top: 10rpx;
							display: flex;
							justify-content: space-between;

							.pl_ut_l {
								display: flex;
							}

							.pl_ut_r {
								display: flex;

								.incs {
									width: 2rpx;
									height: 36rpx;
									background: #999;
									margin-left: 16rpx;
									margin-top: 5rpx;
									margin-right: 10rpx;
									opacity: 0.2;
								}
							}
						}
					}
				}

				.comment:nth-child(n+2) {
					margin-top: 20rpx;
					border-top: 4rpx solid #F8F9FE;
				}
			}
		}
	}

	.modelcon {
		width: 526rpx;
		height: 360rpx;
		padding-top: 30rpx;
    background-color: #fff;
    border-radius: 32rpx;
		.favs {
			text-align: center;
			color: #000;
			font-family: "Microsoft YaHei UI";
			font-size: 36rpx;
			font-weight: 400;
		}

		.fav_v {
			padding: 20rpx 30rpx 0rpx 30rpx;
			// text-align: center;
			color: #666;
			font-family: "Microsoft YaHei UI";
			font-size: 32rpx;
			font-weight: 400;
      line-height: 45rpx;
		}

		.foot_btn {
			display: flex;
			padding: 20rpx 35rpx 0rpx 35rpx;
			justify-content: center;
			.btns {
				width: 358rpx;
				height: 80rpx;
				text-align: center;
				line-height: 80rpx;
				border-radius: 10rpx;
			}

			.su {
				background: #5DB175;
				color: #fff;
			}

			.can {
				border: 2rpx solid #5DB175;
				color: #5DB175;
			}
		}
	}

	//暂
	.balance_box {
		width: 722rpx;
		height: 158rpx;
		position: fixed;
		bottom: 60rpx;
		left: 16rpx;
		z-index: 1010211;

		.bottom_balance {
			width: 100%;
			height: 98rpx;
			border-radius: 104rpx;
			background: #231F20;
			box-shadow: 0rpx 0rpx 40rpx 0rpx rgba(0, 0, 0, 0.30);
			position: absolute;
			bottom: 0rpx;
			left: 0rpx;
			display: flex;
			align-items: center;

			.imagess {
				width: 100rpx;
				height: 100rpx;
				position: relative;
				bottom: 30rpx;
				left: 10rpx;
			}

			.total {
				width: 40rpx;
				height: 40rpx;
				border-radius: 50%;
				// background: #FC4C40;
				position: absolute;
				top: -10rpx;
				right: -10rpx;
				color: #FFF;
				font-family: "Microsoft YaHei UI";
				font-size: 28rpx;
				font-style: normal;
				font-weight: 400;
				text-align: center;
				line-height: 40rpx;
			}
		}

		.amount {
			min-width: 165rpx;
			height: 76rpx;
			margin-left: 54rpx;

			.unit {
				color: #FFF;
				font-family: "Microsoft YaHei UI";
				font-size: 14px;
				font-style: normal;
				font-weight: 700;
				line-height: 90rpx;
			}

			.totalPay {
				color: #FFF;
				font-family: "Microsoft YaHei UI";
				font-size: 60rpx;
				font-style: normal;
				font-weight: 700;
				margin-left: 8rpx;
			}
		}

		.reduction {
			width: 207rpx;
			height: 60rpx;
			margin-left: -41rpx;

			.totalReduce {
				color: #FFF;
				font-family: "Microsoft YaHei UI";
				font-size: 24rpx;
				font-style: normal;
				font-weight: 400;
				text-decoration: line-through;
				margin-top: 28rpx;

			}

			.deliveryFee {
				color: #FFF;
				font-family: "Microsoft YaHei UI";
				font-size: 24rpx;
				font-style: normal;
				font-weight: 400;
				opacity: .6;
			}
		}

		.submitBtn {
			width: 202rpx;
			height: 92rpx;
			border-radius: 36px;
			background: #53A87F;
			text-align: center;
			line-height: 92rpx;
			color: #FFF;
			font-family: "Microsoft YaHei UI";
			font-size: 28rpx;
			font-style: normal;
			font-weight: 700;
			margin-left: auto;
			margin-right: 5rpx;
		}

	}

	.content_imgss {
		width: 90%;
		height: 490rpx;
		margin-left: 5%;
		margin-top: 20rpx;
		margin-bottom: 20rpx;
		border-radius: 20rpx;
		background: #F6F7FB;
		padding: 15rpx;

		.item_contentsw {
			width: 100%;
			height: 100%;
			padding-right: 20rpx;
		}
	}
	.zicobox{
		font-size:32rpx;
		display: block;
		margin-top:5rpx;
		margin-right: 5rpx;	
		&.red{
			color: #FE4066;
		}
		&.gry{
			color: #dbdbdb;
		}
	} 
</style>